package cn.edu.scau.sec.rw.model.pro_manage.pro_dispatch;

import cn.edu.scau.sec.rw.model.disk_file.file.ExeFile;
import cn.edu.scau.sec.rw.model.pro_manage.Process;
import cn.edu.scau.sec.rw.model.pro_manage.ProcessControl;
import cn.edu.scau.sec.rw.model.pro_manage.simulation.CPU;

/**
 *
 */
public class Dispatch {
    private static ProcessControl processControl = new ProcessControl();
    public static void initProcess(ExeFile exeFile) {
         Process process = processControl.creatProcess();
         if (process.getPCB() != null) {
             //分配内存

             //将可执行文件转成指令集
             process.getPCB().getRegister().setIR(exeFile.getStatements());

             processControl.startProcess(process);
         }
     }
}
